<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
    <!--
        当不设置时，视口默认是980
        viewport 视口设置，解决移动端屏幕过小，移动端特有设置
    -->
    <title>Document</title>
    <script>
        //解决像素比问题
        (function () {
      var metaEl = document.createElement('meta');
      var scale = devicePixelRatio;
      metaEl.setAttribute('name', 'viewport');
      metaEl.setAttribute('content', 'initial-scale=' + (1/scale) + ', maximum-scale=' + (1/scale) + ', minimum-scale=' + (1/scale) + ', user-scalable=no');
      document.documentElement.firstElementChild.appendChild(metaEl);
        })();
    </script>
    <style>
        #box {
            width: 200px;
            height: 200px;
            background-color: aquamarine;
        }
    </style>
</head>
<body>
    <div id="box"></div>
</body>
</html>